package com.fdb.efp.nls.service.dao;

import com.fdb.efp.nls.service.domain.RscWarnLoan;
import com.fdb.efp.nls.service.vo.RscWarnLoanVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>DAO interface:风险预警台账				<p>
 *
 * @author chenqm1
 * @date 2018-05-07
 */
public interface RscWarnLoanDao {

    public int insertRscWarnLoan(RscWarnLoan rscWarnLoan);

    public int deleteByPk(RscWarnLoan rscWarnLoan);

    public int updateByPk(RscWarnLoan rscWarnLoan);

    public RscWarnLoan queryByPk(RscWarnLoan rscWarnLoan);

    public List<RscWarnLoan> queryAllOwnerByPage(RscWarnLoanVO rscWarnLoan);

    public List<RscWarnLoan> queryAllCurrOrgByPage(RscWarnLoanVO rscWarnLoan);

    public List<RscWarnLoan> queryAllCurrDownOrgByPage(RscWarnLoanVO rscWarnLoan);

    public List<RscWarnLoanVO> queryRscWarnLoanOut(RscWarnLoanVO rscWarnLoanVO);

    public List<RscWarnLoanVO> queryRscWarnLoan(RscWarnLoan rscWarnLoan);

    //C查询未结清合同最新的风险预警信息
    public List<RscWarnLoan> queryByContNo();

    //查询该客户下最新一次所有的风险预警信息
    public List<RscWarnLoan> queryBytaskNo(RscWarnLoanVO rscWarnLoanVO);

    /**
     * 根据合同编号列表查询风险预警台账
     *
     * @param warn 查询条件
     * @return
     */
    public List<RscWarnLoan> queryRscWarnLoanByContNosByPage(@Param("contNos") List<String> contNos);

    //批量新增风险预警台账
    public int insertBatchRscWarnLoan(@Param("rscWarnLoan") List<RscWarnLoan> rscWarnLoans);

    public void deleteBydaybatDate(String daybatDate);

    public int rscWarnLoanCusHandOver(@Param("fromUser") String fromUser, @Param("toUser") String toUser, @Param("fromBrId") String fromBrId, @Param("toBrId") String toBrId, @Param("cusIds") List<String> cusIds);

    public int updateRscData(RscWarnLoan rscWarnLoan);

    public RscWarnLoan queryByCond(RscWarnLoan rscWarnLoan);

    public List<RscWarnLoan> queryExAllOwner(RscWarnLoanVO rscWarnLoanVo);

    public List<RscWarnLoan> queryExAllCurrOrg(RscWarnLoanVO rscWarnLoanVo);

    public List<RscWarnLoan> queryExAllCurrDownOrg(RscWarnLoanVO rscWarnLoanVo);

    public int deleteAllUserinfo(@Param("dblNo") String dblNo, @Param("custNo") String custNo);

    public int batchInsertRscData(@Param("rscWarnLoanList") List<RscWarnLoanVO> rscWarnLoanList);

    public List<RscWarnLoan> queryByCondByPage(RscWarnLoanVO rscWarnLoanVo);

    /**
     * 通过短信发送标识查询数据
     *
     * @param rscWarnLoanVo
     * @return
     */
    public List<RscWarnLoan> queryBySendFlagByPage(RscWarnLoanVO rscWarnLoanVo);

    public List<RscWarnLoan> queryByDealFlagByPage(RscWarnLoanVO rscWarnLoanVo);

    /**
     * 通过短信发送标识查询数据统计数据量
     *
     * @return
     */
    public int queryBySendFlagCount();

    public int queryByDealFlagCount();

    /**
     * 通过借据号更新短信发送标识
     *
     * @param rscWarnLoan
     * @return
     */
    public int updateSendFlagByBillNo(RscWarnLoan rscWarnLoan);

    public int updateDealFlagByBillNo(RscWarnLoan rscWarnLoan);

    List<RscWarnLoan> queryByCertCode(@Param("certCode") String certCode, @Param("certType") String certType);

	/**
	 * 优e贷使用
	 *
	 * @param rscWarnLoanVo
	 * @return
	 */
	public List<RscWarnLoan> query2BySendFlagByPage(RscWarnLoanVO rscWarnLoanVo);
	public List<RscWarnLoan> query2ByDealFlagByPage(RscWarnLoanVO rscWarnLoanVo);
	public int query2BySendFlagCount();
	public int query2ByDealFlagCount();
}
